#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
int main()
{

	pid_t pid;
	pid = fork();
	if(pid < 0)
	{
		perror("fork\n");
	}else if(pid == 0)
	{
		printf("子进程创建成功\n");

		printf("pid = %d, ppid = %d", getpid(), getppid());
		sleep(10);
	}else
	{
		printf("父进程\n");
		exit(0);
	}
}
